﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace PSE.Deployment.ConfigurationManager.Controls
{
	/// <summary>
	/// UserControl que instancia um Label pronto para Binding
	/// </summary>
	public class SimpleLabel : Label
	{
		private SimpleLabel()
		{
			this.SetResourceReference(SimpleLabel.StyleProperty, "LabelFont");
		}

		public SimpleLabel(object content) : this()
		{
			//this.InsertTwoPoints(content);
			this.Content = content;
		}

		public SimpleLabel(object content, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) : this(content)
		{
			this.HorizontalAlignment = horizontalAlignment;
			this.VerticalAlignment = verticalAlignment;
		}

		public SimpleLabel(object content, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, Brush brush, double fontSize) : this(content)
		{
			this.HorizontalAlignment = horizontalAlignment;
			this.VerticalAlignment = verticalAlignment;
			this.Foreground = brush;
			this.FontSize = fontSize;
		}

		//void InsertTwoPoints(object content)
		//{
		//    if (content != null && content is string)
		//    {
		//        string strContent = content.ToString();
				
		//        if (strContent.EndsWith(":"))
		//            this.Content = content;
		//        else
		//            this.Content = content + ":";
		//    }
		//}
	}
}